package com.boot3.ssm.controller;

import com.boot3.ssm.bean.TUser;
import com.boot3.ssm.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    UserMapper userMapper;
    @GetMapping(value = "/user/{id}")
    public TUser getUserById(@PathVariable("id") Long id){
        TUser userById = userMapper.getUserById(id);
        return userById;
    }

    @GetMapping("/test")
    public String test(){
        return "test";
    }

}
